package com.hades.xq.single;

/**
 * 第一种形式:懒汉式，也是常用的形式。
 */
public class Singleton1 {

    private Singleton1() {
    }

    private static Singleton1 instance = null;

    public static synchronized Singleton1 getInstance() {
        if (instance == null) {
            instance = new Singleton1();
        }
        return instance;
    }
}